#include <iostream>

#include "time_analyzer.h"

int
main(int argc, char* argv[])
{
  if (argc != 2) {
    std::cerr << "Usage: " << argv[0] << " input_file" << std::endl;
    return 1;
  }

  ResultType result = time_analyze(argv[1]);
  ResultType::const_iterator it = result.begin();
  for (; it != result.end(); ++it) {
    Result line = (*it).second;
    std::cout << line.cum_ncalls << " " << line.cum_time << " "
              << line.cum_percall << " " << line.total_ncalls << " "
              << line.total_time << " " << line.total_percall << " "
              << line.whole[0] << " " << line.whole[1] << " "
              << line.pure[0] << " " << line.pure[1] << " "
              << (*it).first << std::endl;
  }

  return 0;
}
